package org.hamster.common.utils
{
	import mx.collections.ArrayCollection;
	import mx.collections.IList;

	public class ArrayUtils
	{
		public static function clone(obj:*):*
		{
			var item:*;
			if (obj is ArrayCollection) {
				var arrayCollection:ArrayCollection = new ArrayCollection();
				for each (item in obj) {
					arrayCollection.addItem(item);
				}
				return arrayCollection;
			} else if (obj is Array) {
				var array:Array = new Array();
				for each (item in obj) {
					array.push(item);
				}
				return array;
			} else if (obj is Vector) {
				var vector:Vector = new Vector();
				for each (item in obj) {
					vector.push(item);
				}
				return vector;
			}
			return null;
		}
	}
}